//
//  LCZFMDatabase.h
//  PersonalNews
//
//  Created by dllo on 15/12/4.
//  Copyright © 2015年 changshuhua. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDatabase.h"
#import "LCZBaseModel.h"
#import "LCZLastColumnModel.h"


#define PATH_OF_DOCUMENT  [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]

typedef NS_ENUM(NSUInteger, ModelStyle) {
    LCZStyleOfAVModel,
    LCZStyleOfNewsModel,
    LCZStyleOfReadModel,
};

typedef NS_ENUM(NSUInteger, SelectHouse){
    Intable,
    Notintable,
};


@interface LCZFMDatabase : NSObject



@property (nonatomic, copy)NSString *dbPath;
+ (instancetype)shareFMDatabase;

///打开数据库并创建表
- (void)openDB:(NSInteger)ModelStyle;


///插入数据
- (void)insertData:(id)model :(NSInteger)ModelStyle;

/**
 *  查询数据
 */
- (NSMutableArray *)queryData:(NSInteger)ModelStyle;


// 删除数据
- (void)clearAll:(id)model;

// 查询数据库是否存在
- (BOOL)selectAllByLCZColumnModelTitle:(NSString *)title;

@end
